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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.y: B = None
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.y: B = None
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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