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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.x: D = None
        self.z: D = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
e = C("e")
l = D("l")
j = E("j")
h = F("h")
n = D("n")
m = A("m")

g.p = n
g.u = h
g.s = e
i.o = h
i.s = h
e.t = h
e.w = j
e.o = j
e.x = n
e.z = l
e.u = i
l.r = i
l.u = h
j.v = m
h.t = l
h.o = j
n.r = i
n.u = h
m.p = l
m.u = h
m.s = e
assert l.r.s.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: F = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.x: D = None
        self.z: D = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
e = C("e")
l = D("l")
j = E("j")
h = F("h")
n = D("n")
m = A("m")

g.p = n
g.u = h
g.s = e
i.o = h
i.s = h
e.t = h
e.w = j
e.o = j
e.x = n
e.z = l
e.u = i
l.r = i
l.u = h
j.v = m
h.t = l
h.o = j
n.r = i
n.u = h
m.p = l
m.u = h
m.s = e
assert l.r.s.t.u.t.txt == "l"