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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: B = None
        self.y: B = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

b.x = m
d.t = e
d.x = e
d.o = n
d.y = n
d.s = g
m.r = l
m.v = l
m.o = l
m.p = i
g.t = d
g.o = b
l.w = d
l.o = m
l.q = m
e.w = f
e.z = g
e.y = d
e.v = b
f.x = m
n.t = e
n.x = e
n.o = d
n.y = d
n.s = i
i.t = d
i.o = b
assert e.w.x.o.w.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: B = None
        self.y: B = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

b.x = m
d.t = e
d.x = e
d.o = n
d.y = n
d.s = g
m.r = l
m.v = l
m.o = l
m.p = i
g.t = d
g.o = b
l.w = d
l.o = m
l.q = m
e.w = f
e.z = g
e.y = d
e.v = b
f.x = m
n.t = e
n.x = e
n.o = d
n.y = d
n.s = i
i.t = d
i.o = b
assert e.w.x.o.w.x.v.txt == "b"