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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.o: B = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: H = None
        self.t: F = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.o: B = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: H = None
        self.t: F = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

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

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