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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: A = None
        self.w: B = None
        self.v: A = None
        self.r: E = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.q: D = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

b.u = m
a.s = j
j.w = m
l.s = d
l.z = b
l.v = b
l.w = a
l.r = f
l.o = f
l.u = j
f.o = m
f.y = a
d.u = b
d.r = l
m.x = b
m.w = f
m.v = f
m.q = l
m.o = j
assert d.r.s.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: A = None
        self.w: B = None
        self.v: A = None
        self.r: E = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.q: D = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

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