class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.o: E = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.u: A = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
e = C("e")
l = D("l")
f = E("f")
d = F("d")
g = D("g")
m = C("m")
i = B("i")

b.y = a
b.q = d
b.t = d
b.o = f
a.t = i
a.r = i
a.y = f
a.v = g
e.v = a
l.q = g
l.v = e
l.u = b
l.t = b
l.y = b
f.u = b
d.t = m
d.v = m
d.w = e
g.q = l
g.v = m
g.u = b
g.t = b
g.y = b
m.v = a
i.t = a
i.r = a
i.y = f
i.v = g
assert a.y.u.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.o: E = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.u: A = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
e = C("e")
l = D("l")
f = E("f")
d = F("d")
g = D("g")
m = C("m")
i = B("i")

b.y = a
b.q = d
b.t = d
b.o = f
a.t = i
a.r = i
a.y = f
a.v = g
e.v = a
l.q = g
l.v = e
l.u = b
l.t = b
l.y = b
f.u = b
d.t = m
d.v = m
d.w = e
g.q = l
g.v = m
g.u = b
g.t = b
g.y = b
m.v = a
i.t = a
i.r = a
i.y = f
i.v = g
assert a.y.u.y.y.txt == "f"