class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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