class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.q: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.x: B = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
c = D("c")
l = E("l")
i = F("i")
h = E("h")
d = C("d")
g = F("g")

n.u = m
n.q = m
n.z = k
n.r = c
k.w = c
k.u = l
m.p = n
m.z = n
m.y = g
m.x = k
m.u = h
c.z = n
c.o = n
c.x = h
l.o = c
l.y = k
l.r = k
l.u = g
i.u = g
i.y = g
h.o = c
h.y = k
h.r = k
h.u = i
d.p = n
d.z = n
d.y = g
d.x = k
d.u = l
g.u = i
g.y = i
assert d.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.q: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.x: B = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
c = D("c")
l = E("l")
i = F("i")
h = E("h")
d = C("d")
g = F("g")

n.u = m
n.q = m
n.z = k
n.r = c
k.w = c
k.u = l
m.p = n
m.z = n
m.y = g
m.x = k
m.u = h
c.z = n
c.o = n
c.x = h
l.o = c
l.y = k
l.r = k
l.u = g
i.u = g
i.y = g
h.o = c
h.y = k
h.r = k
h.u = i
d.p = n
d.z = n
d.y = g
d.x = k
d.u = l
g.u = i
g.y = i
assert d.y.y.y.txt == "g"