class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: D = None
        self.r: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

b.v = e
b.y = a
b.r = a
b.s = a
b.q = l
g.o = l
l.t = n
l.x = g
l.u = b
l.r = e
a.p = g
a.u = e
a.w = b
a.o = n
e.w = g
e.r = b
d.v = a
d.z = l
h.v = a
h.z = l
j.v = a
j.z = n
n.t = l
n.x = g
n.u = b
n.r = e
assert n.t.u.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: D = None
        self.r: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

b.v = e
b.y = a
b.r = a
b.s = a
b.q = l
g.o = l
l.t = n
l.x = g
l.u = b
l.r = e
a.p = g
a.u = e
a.w = b
a.o = n
e.w = g
e.r = b
d.v = a
d.z = l
h.v = a
h.z = l
j.v = a
j.z = n
n.t = l
n.x = g
n.u = b
n.r = e
assert n.t.u.v.r.txt == "b"