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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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