class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: C = None
        self.t: B = None
        self.z: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: F = None
        self.x: A = None
        self.z: E = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.u: F = None
        self.x: E = None
        self.z: E = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: F = None
        self.x: A = None
        self.z: E = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.u: F = None
        self.x: E = None
        self.z: E = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

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