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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: D = None
        self.z: E = None
        self.x: B = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: D = None
        self.z: E = None
        self.x: B = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

a.x = c
a.u = c
h.r = l
h.v = a
d.t = l
d.z = l
d.v = f
d.x = h
d.s = c
d.w = a
f.q = h
l.y = b
l.v = b
l.x = b
l.q = b
l.r = h
l.u = a
b.r = c
b.z = f
b.s = f
c.p = a
c.r = a
c.x = f
c.t = l
c.y = l
c.o = d
assert l.y.r.o.t.u.u.txt == "c"