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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.o: F = None
        self.v: E = None
        self.p: F = None
        self.y: D = 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.y: C = None
        self.txt = txt

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

c = A("c")
j = B("j")
g = C("g")
b = D("b")
f = E("f")
d = F("d")
e = C("e")
l = A("l")
i = F("i")

c.q = j
j.t = f
g.w = f
g.r = f
g.v = f
g.o = d
g.p = d
g.y = b
b.o = l
f.y = e
d.q = c
d.z = c
e.w = f
e.r = f
e.v = f
e.o = i
e.p = i
e.y = b
l.q = j
i.q = l
i.z = l
assert e.p.q.q.t.y.r.y.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.o: F = None
        self.v: E = None
        self.p: F = None
        self.y: D = 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.y: C = None
        self.txt = txt

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

c = A("c")
j = B("j")
g = C("g")
b = D("b")
f = E("f")
d = F("d")
e = C("e")
l = A("l")
i = F("i")

c.q = j
j.t = f
g.w = f
g.r = f
g.v = f
g.o = d
g.p = d
g.y = b
b.o = l
f.y = e
d.q = c
d.z = c
e.w = f
e.r = f
e.v = f
e.o = i
e.p = i
e.y = b
l.q = j
i.q = l
i.z = l
assert e.p.q.q.t.y.r.y.y.o.txt == "l"