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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: A = None
        self.r: A = None
        self.w: D = None
        self.z: H = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
e = D("e")
g = E("g")
a = F("a")
k = G("k")
d = H("d")
l = A("l")

c.q = g
c.u = g
c.x = g
c.p = g
c.v = e
f.r = e
f.t = l
b.s = g
e.o = l
g.p = k
g.q = f
a.v = e
a.w = e
a.t = e
a.p = g
a.s = c
a.r = l
a.z = d
a.y = f
k.o = l
k.y = g
k.q = d
d.o = k
l.q = g
l.u = g
l.x = g
l.p = g
l.v = e
assert g.q.r.o.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.u: E = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: A = None
        self.r: A = None
        self.w: D = None
        self.z: H = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
e = D("e")
g = E("g")
a = F("a")
k = G("k")
d = H("d")
l = A("l")

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