class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: F = None
        self.v: C = None
        self.x: C = None
        self.q: D = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: E = None
        self.txt = txt

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

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