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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.p: E = None
        self.r: A = None
        self.s: E = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

i = A("i")
k = B("k")
c = C("c")
e = D("e")
l = E("l")
b = F("b")
m = G("m")
h = D("h")
a = G("a")

i.u = c
i.v = c
i.x = h
k.v = c
k.p = l
k.w = l
k.q = a
c.t = l
e.t = i
e.v = b
l.t = a
l.z = b
l.u = k
l.y = k
b.q = e
b.s = m
b.z = i
m.z = a
m.o = c
m.p = l
m.s = l
m.r = i
m.x = i
m.q = i
h.t = i
h.v = b
a.z = m
a.o = c
a.p = l
a.s = l
a.r = i
a.x = i
a.q = i
assert a.x.v.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.p: E = None
        self.r: A = None
        self.s: E = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

i = A("i")
k = B("k")
c = C("c")
e = D("e")
l = E("l")
b = F("b")
m = G("m")
h = D("h")
a = G("a")

i.u = c
i.v = c
i.x = h
k.v = c
k.p = l
k.w = l
k.q = a
c.t = l
e.t = i
e.v = b
l.t = a
l.z = b
l.u = k
l.y = k
b.q = e
b.s = m
b.z = i
m.z = a
m.o = c
m.p = l
m.s = l
m.r = i
m.x = i
m.q = i
h.t = i
h.v = b
a.z = m
a.o = c
a.p = l
a.s = l
a.r = i
a.x = i
a.q = i
assert a.x.v.t.z.txt == "b"