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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

f.t = j
f.s = c
f.x = c
f.p = n
h.x = j
h.r = f
h.q = l
h.y = l
h.p = c
c.w = e
c.y = f
c.z = l
n.t = c
n.u = f
n.z = j
l.o = h
l.s = h
l.x = j
l.u = j
j.y = c
j.t = f
e.w = c
e.y = f
e.z = l
assert j.t.p.z.txt == "j"