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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.q: G = None
        self.z: F = None
        self.s: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.v: E = None
        self.t: G = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

c = A("c")
k = B("k")
j = C("j")
f = D("f")
a = E("a")
b = F("b")
d = G("d")
g = E("g")

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.q: G = None
        self.z: F = None
        self.s: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.v: E = None
        self.t: G = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

c = A("c")
k = B("k")
j = C("j")
f = D("f")
a = E("a")
b = F("b")
d = G("d")
g = E("g")

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