class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: G = None
        self.w: C = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: F = None
        self.t: A = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.txt = txt

c = A("c")
k = B("k")
d = C("d")
l = D("l")
m = E("m")
a = F("a")
e = G("e")
j = C("j")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: G = None
        self.w: C = None
        self.v: B = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: F = None
        self.t: A = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.txt = txt

c = A("c")
k = B("k")
d = C("d")
l = D("l")
m = E("m")
a = F("a")
e = G("e")
j = C("j")

c.q = j
c.o = k
c.t = k
k.o = c
d.x = m
d.s = e
d.z = e
d.w = j
d.v = k
l.u = m
m.q = e
m.u = a
m.o = a
m.t = c
m.w = c
a.u = j
a.y = j
e.y = c
e.t = c
j.x = m
j.s = e
j.z = e
j.w = d
j.v = k
assert d.z.t.o.o.q.txt == "j"