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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.r: A = None
        self.q: B = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: A = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

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

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

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

j.p = n
j.u = l
j.q = l
j.y = k
g.t = k
g.u = l
g.p = n
l.z = e
l.o = e
l.r = j
l.q = g
l.y = h
l.x = c
c.x = l
c.t = j
c.r = n
c.q = h
h.u = g
n.x = l
n.y = l
n.z = l
n.v = l
n.q = j
e.x = l
e.t = j
e.r = n
e.q = h
k.u = g
assert j.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: C = None
        self.q: C = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.r: A = None
        self.q: B = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: A = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

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

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

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

j.p = n
j.u = l
j.q = l
j.y = k
g.t = k
g.u = l
g.p = n
l.z = e
l.o = e
l.r = j
l.q = g
l.y = h
l.x = c
c.x = l
c.t = j
c.r = n
c.q = h
h.u = g
n.x = l
n.y = l
n.z = l
n.v = l
n.q = j
e.x = l
e.t = j
e.r = n
e.q = h
k.u = g
assert j.y.u.u.txt == "l"