class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.u: C = None
        self.q: A = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.u: A = None
        self.v: C = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: B = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
b = D("b")
e = E("e")
h = F("h")
j = B("j")
n = E("n")
m = A("m")

c.x = n
c.w = k
c.u = k
c.r = k
c.q = m
c.v = b
g.o = m
g.u = m
g.p = c
g.v = k
g.w = j
g.y = h
k.q = h
k.y = e
k.w = e
k.v = b
b.z = n
e.q = h
h.y = b
h.v = g
j.o = m
j.p = m
j.u = m
j.v = k
j.w = g
j.y = h
n.q = h
m.x = n
m.w = k
m.u = k
m.r = k
m.q = c
m.v = b
assert c.x.q.y.z.q.y.z.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.u: C = None
        self.q: A = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.u: A = None
        self.v: C = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: B = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
b = D("b")
e = E("e")
h = F("h")
j = B("j")
n = E("n")
m = A("m")

c.x = n
c.w = k
c.u = k
c.r = k
c.q = m
c.v = b
g.o = m
g.u = m
g.p = c
g.v = k
g.w = j
g.y = h
k.q = h
k.y = e
k.w = e
k.v = b
b.z = n
e.q = h
h.y = b
h.v = g
j.o = m
j.p = m
j.u = m
j.v = k
j.w = g
j.y = h
n.q = h
m.x = n
m.w = k
m.u = k
m.r = k
m.q = c
m.v = b
assert c.x.q.y.z.q.y.z.q.y.txt == "b"