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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

h.s = b
h.p = j
h.u = e
h.w = d
a.x = h
a.t = h
a.q = l
a.p = j
a.v = c
d.p = c
f.q = e
b.w = d
b.s = c
b.u = c
b.r = h
j.x = b
l.x = h
l.t = h
l.q = a
l.p = j
l.v = c
c.w = d
c.s = b
c.u = b
c.r = h
e.q = f
assert f.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: F = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

h.s = b
h.p = j
h.u = e
h.w = d
a.x = h
a.t = h
a.q = l
a.p = j
a.v = c
d.p = c
f.q = e
b.w = d
b.s = c
b.u = c
b.r = h
j.x = b
l.x = h
l.t = h
l.q = a
l.p = j
l.v = c
c.w = d
c.s = b
c.u = b
c.r = h
e.q = f
assert f.q.q.q.txt == "e"