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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: G = None
        self.v: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: B = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.t: B = None
        self.v: C = None
        self.p: G = None
        self.r: E = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: G = None
        self.v: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: B = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.t: B = None
        self.v: C = None
        self.p: G = None
        self.r: E = None
        self.x: C = None
        self.txt = txt

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

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