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

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

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

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

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

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

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

b.y = h
b.o = h
c.w = d
c.x = l
d.s = e
e.o = d
m.y = d
m.p = l
a.q = e
a.x = d
a.t = m
l.y = e
l.o = h
h.o = d
g.y = d
g.p = b
j.q = e
j.x = d
j.t = g
assert b.o.o.s.o.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

b.y = h
b.o = h
c.w = d
c.x = l
d.s = e
e.o = d
m.y = d
m.p = l
a.q = e
a.x = d
a.t = m
l.y = e
l.o = h
h.o = d
g.y = d
g.p = b
j.q = e
j.x = d
j.t = g
assert b.o.o.s.o.s.o.s.txt == "e"