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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: B = None
        self.r: C = None
        self.t: E = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
a = C("a")
e = D("e")
j = E("j")
l = F("l")
h = C("h")
c = D("c")

g.r = k
g.v = c
g.q = h
g.o = h
g.z = l
k.x = l
a.u = g
a.z = g
a.s = k
e.q = g
e.s = k
e.r = a
e.t = j
e.p = j
e.y = c
j.s = e
j.x = c
j.w = c
j.o = k
l.p = j
l.q = g
l.v = g
h.u = g
h.z = g
h.s = k
c.q = g
c.s = k
c.r = h
c.t = j
c.p = j
c.y = e
assert a.z.z.q.z.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: D = None
        self.q: C = None
        self.z: F = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: B = None
        self.r: C = None
        self.t: E = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
a = C("a")
e = D("e")
j = E("j")
l = F("l")
h = C("h")
c = D("c")

g.r = k
g.v = c
g.q = h
g.o = h
g.z = l
k.x = l
a.u = g
a.z = g
a.s = k
e.q = g
e.s = k
e.r = a
e.t = j
e.p = j
e.y = c
j.s = e
j.x = c
j.w = c
j.o = k
l.p = j
l.q = g
l.v = g
h.u = g
h.z = g
h.s = k
c.q = g
c.s = k
c.r = h
c.t = j
c.p = j
c.y = e
assert a.z.z.q.z.q.r.txt == "k"