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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.s: E = None
        self.z: E = None
        self.q: C = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.r: B = None
        self.w: F = None
        self.y: F = None
        self.p: A = None
        self.txt = txt

m = A("m")
i = B("i")
k = C("k")
j = D("j")
c = E("c")
f = F("f")
b = G("b")

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.s: E = None
        self.z: E = None
        self.q: C = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.r: B = None
        self.w: F = None
        self.y: F = None
        self.p: A = None
        self.txt = txt

m = A("m")
i = B("i")
k = C("k")
j = D("j")
c = E("c")
f = F("f")
b = G("b")

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