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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: A = None
        self.y: F = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
i = C("i")
c = D("c")
b = E("b")
m = F("m")
l = C("l")
e = B("e")

h.r = l
h.y = i
h.u = m
h.t = a
a.t = h
i.s = a
i.w = h
i.r = h
i.v = h
i.y = m
c.u = b
c.w = h
c.v = h
c.o = l
c.x = m
b.v = h
b.z = c
b.x = c
b.q = m
b.o = a
m.x = h
m.r = b
m.w = e
m.p = c
l.s = a
l.w = h
l.r = h
l.v = h
l.y = m
e.t = h
assert a.t.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: C = None
        self.u: F = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: A = None
        self.y: F = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
i = C("i")
c = D("c")
b = E("b")
m = F("m")
l = C("l")
e = B("e")

h.r = l
h.y = i
h.u = m
h.t = a
a.t = h
i.s = a
i.w = h
i.r = h
i.v = h
i.y = m
c.u = b
c.w = h
c.v = h
c.o = l
c.x = m
b.v = h
b.z = c
b.x = c
b.q = m
b.o = a
m.x = h
m.r = b
m.w = e
m.p = c
l.s = a
l.w = h
l.r = h
l.v = h
l.y = m
e.t = h
assert a.t.r.w.txt == "h"