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

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

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

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

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

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

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

l.o = e
l.y = d
m.t = l
m.v = h
n.w = l
n.z = l
n.x = j
n.t = m
c.r = b
j.x = m
j.z = m
j.v = n
j.o = n
j.y = e
e.t = l
d.w = l
d.z = l
d.x = j
d.t = m
h.r = b
b.r = c
assert e.t.y.x.x.t.y.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

l.o = e
l.y = d
m.t = l
m.v = h
n.w = l
n.z = l
n.x = j
n.t = m
c.r = b
j.x = m
j.z = m
j.v = n
j.o = n
j.y = e
e.t = l
d.w = l
d.z = l
d.x = j
d.t = m
h.r = b
b.r = c
assert e.t.y.x.x.t.y.t.t.txt == "l"